#ifndef _RENDERER_H_
#define _RENDERER_H_

#include <Gwen/Renderers/OpenGL.h>
#include <ft2build.h>
#include FT_FREETYPE_H
#include <map>

namespace PF
{
	struct FontData
	{
		Gwen::Texture *m_pTexture;
		int m_iWidth;
		int m_iHeight;
		int m_iLeft;
		int m_iTop;
		FT_Vector m_vAdvance;
	};

	class Renderer : public Gwen::Renderer::OpenGL
	{
	public:
		Renderer();
		~Renderer();

		void LoadTexture(Gwen::Texture *a_pTexture);

		void LoadFont(Gwen::Font* a_pFont);
		void FreeFont(Gwen::Font* a_pFont);
		void RenderText(Gwen::Font* a_pFont, Gwen::Point a_kPos, const Gwen::UnicodeString& a_szText);
		Gwen::Point MeasureText(Gwen::Font *a_pFont, const Gwen::UnicodeString &a_szText);

	private:
		FT_Library m_kLibrary;
		std::map<std::wstring, Gwen::Texture> m_kTextureMap;
	};
}

#endif // _RENDERER_H_
